package com.xuecheng.feignclient;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


@Slf4j
@Component
public class SearchServiceClientFallbackFactory implements FallbackFactory<SearchServiceClient> {
	@Override
	public SearchServiceClient create(Throwable throwable) {
		return courseIndexDTO -> {
			log.error("调用搜索发生熔断走降级方法,熔断异常:{}", throwable.getMessage());
			return false;
		};
	}
}
